replace lib and bugfix