make it less cpu hungry+better error logs