fixed negative tip calculation