Fixed bug when exception rises in create controller $e variable became ambiguous. And fixed trouble with incorrect permission mode for chmod function.