JC: fixed bugs. More CN. Removed projectx_helper and moved code into application controller to solve the lost session issue.