Fixes error handle