properly cleans up errors after compiling