fixed npe with upload in production