fixed some bugs on user and admin side