fixed more critical bugs