custom hiding and showing of modal