fixing missmatch bug