Ibn Abbbas narrated:
"Allah's Messenger cursed the women who visit the graves, and those who use them as Masajid and put torches on them."