fix bug in get_availbale space