now woks partially as it should