add libs, correct index