refactored the code:
added ng-show and ng-hide, uploading working