adjusting logic to complete feature request