updated lib script for sync