added debugger gem and fixed redirect bug