fix code to set default values and remove redundant synchronization