fixed a bug in one of the lib functions; use querySelector when possible