test if file is present before removing