Know it's a old snippet, but it really is nice, works great except for the error code, does anyone know how to fix that bug ?