fix functions to work on show page