fixes bugs in user's controller