took readFileSync out of app function