add more error handling stuff