Added return stmts for dispatch function