fixed + new features for lib