bugfix for file order and cleanup