fixed segfaults in captiveportal apache
fixed wrong $error variables from old catchs