Fixed a bug where used double values to compare