Write text update

Added write text function that also adds click handler to text