wrapped potential type error in try/catch to prevent crashing