Modified hide/show spinner code