Jos helped with it. Code is now running fine.