working code on devise