fixed alert box bug, unused code cleanup