changed conditions for returning static file