fixes  #2292

Fixed the issue.

Pushed the code for review.