fix undefined error of user