changed static to session vars, added comments, fixed an issue with broken links after entering invalid barcode