made some changes but still not working as expected