correct a bug where timeline was modified by mouse events while they should not
add loop to timeline