Added file before if statements