fixes availability window calculations