Reordered two function calls to be in the right order.