Fixing bugs in uploader

Bugs fixed:
Internal Server Error 500
File already exists bug