updated for new library api