added checking to unmarked references