fixung issue with using incorrect instance of handler and cleanup of path adding logic