fixes availability time and indexes calculations