fixed error in spinlock causing slowdown and extra check.