fixed some bugs found while testing

Tested login and add functions