adding a stopSpinner utility function