fix js error with check_availability