Changed to object oriented. Should work now!