added sanity checks for uploads directory