Removed dynamic code from jade template. Added check if user object is undefined or not, and to handle accordingly.