rename lib, add a get current frame and fix for looping