add controls and fix a few errors