added pcall to clean up