its shows the correct answer even with negative numbers but it's still giving me error