fix next ui calculation