added register,login,logout function