better exception handling
better upload code