fixing ceil/floor issue