got rid of buggy exit() code and replaced it with a database hack