removed unnecessary global $user lines