fixed bug with sync parameter not being correctly read