added devise with some small changes