added nil check for current_user