Bug fix

and loose file deletion