#8 added direct file access check