File upload bug fix