Fixed wrong assignment bug