fixes bug when assigning