fixed plugin issues

Hi, I have reworked unstuck part and made the plugin more optimized.