runs but not working correctly