fix and finalize registration and add login and logout also change db