fixing a bug in library