malloc changes but is not working