changed the check to actually handle the return value

resolves: http://bugs.web2project.net/view.php?id=1341