handling non-existing file exception consitently