removed incorrect error check