fixed bug, was comparing x to nil