moved a function call to help prevent doubles