Fully working for attach, login and register