Fixed PromptChain bug. Added event handling to promptchain