Created an additional conditional variable called registered