fixed user check from undefined to null