#139 Added logic