Fixed rm command at the end of the process