added better error handling support and less spam