fixed refresh bug, added file upload