fixing bug in library