Added code to while_slewing state function.