Added check for empty user