rearranged variables due to error message