generator not working as intended