add functionality of upload and fixed