fix primary first bug