fixed a bug regarding empty file upload