fixed some bugs, updated login/reg method