MKR100 and ajax web server

Hi

I am trying to get the very nice ajax web server code from the link below to run on the MKR1000 board.

But that was not easy. After changing from Ethernet to wifi in the code the server runs for a few seconds up to 30 second before the server stops. And a minute after the server stops the board totally freeze.

After resetting the board the server startsup again for a few seconds before stopping again.

Is there anyone that might have a clue what the problem might be?

Thanks & regards
Kenneth