added file upload feature and other fixes