Adding helper function isFile