fix error: if have not permit of reading posts directory , raise a fatal error
force to display error at development environment
refactor the code