             $main = $ '#main'
             $form = $main.find 'form.themis-form-signup'
             if $form.length > 0
+                $form.find('input:file').filestyle 'destroy'
                 $form.off 'submit'
             $main.html ''
             navigationBar.dismiss()

        $navbar.html ''


define 'themis', ['jquery', 'stateController', 'bootstrap', 'bootstrap-filestyle'], ($, stateController) ->
    $(document).ready ->
        stateController.init()

                    navigationBar.present()

                    $form = $main.find 'form.themis-form-signup'
                    $form.find('input:file').filestyle()
                    $form.on 'submit', (e) ->
                        e.preventDefault()
                        $form.ajaxSubmit
