fixes #1625

Fixed the issue and committed files, please check it.