modifed to retain selection after form submition