fixed clear error implementation