made sell policy more robust, added some logging