Fix for race condition during scheduler registration(on demand) when there are multiple builds on queue