fixing critical bugs