Fix name of custom event on square. Also, add 'type' to data object