fixed to cover all cases