cleaned up dirmk, safe_rm and added try