Adds a file cleanup call and auto orientation