crazy ass loop fixed
updated application profile email script