fixes critical bug