new update on checkavailability(need further work)