Added state to lib