fixes calculations of availability window