changed routing to switch statement