Errors handling fix