add method called before show