fixed bug, compare instead of assigning