file handles set correctly