refactored
implemented session error populate