Code refactored
check added in user.js