Synchronized the functions