You called an undefined method (refnum), probably mispelt a field?