Adding a Function to handle Synchronization