 {
     
     func imageCropViewControllerDidCancelCrop(controller: HHImageCropViewController) {
-        controller.dismiss(animated: true, completion: nil)
+        controller.dismiss(animated: true, completion: {
+            self.dismiss(animated: true, completion: nil)
+        })
     }
     
     func imageCropViewController(controller: HHImageCropViewController, didCropImage croppedImage: UIImage?, usingCropRect cropRect: CGRect) {

extension HHAvatarPicker: UIImagePickerControllerDelegate, UINavigationControllerDelegate
{
    func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [String : Any]) {
        HUD.hide()
        
        if let chosenImage = self.fixImageOrientation(src: info[UIImagePickerControllerOriginalImage] as? UIImage) {
            picker.dismiss(animated:true, completion: {

    }

    func imagePickerControllerDidCancel(_ picker: UIImagePickerController) {

        picker.dismiss(animated: true, completion: {
            self.dismiss(animated: true, completion: nil)
