Add a attachErrorCallback to indexVM to be able to handle errors