check if file exists before serving it