allow hide to be a function