fixed bugs in modules.php and added giveup option