Fixed a bug on line 204 where $user was not defined.