added check to ensure file is not accessed directly and updated version