synchronizing and handling errors