fixed it in a better way