fix manage.php bugs