added unit tests for fileExists function