created improved method for display error/success messages using sessions