fixes bugs in user controller and index view