fixing errcode