fixes #5966 Dynamic Plugin Tool

Fixed the issue and pushed the code for review, please check it.