Fix NaN bug in user model