Added second parameter to beforeShow callback