fixed threading errors and synced commits