added additional checks around file submission