error handling fix. draw fix