Fixed issue with function in wrong spot.