moves conditional to avoid raise unexpect exception