adding back correct logic