created hide function for modal