added if check instruction for references, fixed if instructions for in & real