fixed not properly checking if reference level is available bug