rework logick for checkink of available