test if moving the call up earlier fixes the problem