Fix issue with Match Error due to partial function chaining (It was returning 500 errors randomly when using session).