fixed permission name and time() function in controller