Fixing errors handling