fixed nullref and added label switching