alan's fix for selling shares