relocated command execturion outside of case switch