add bottle version and fix logic