Updated lib. There has  to be a better way.