Nice script. Thanks!
I have a fix for it. The header function does not allow any whitespaces. So the script does not return to the previous page and displays an empty white page in stead. The line in your script should be:
header("Location:$config[site_base_url]");
without the whitespace after "Location:"
Maybe you should update your script.

Regards