changing order of calling functions