added code to prevent direct file access