Replaced some instances of hide() with visibility=hidden