fixed Statement getCount, remove last only when ;