preShow and postShow method added to differentiate logic