updated to pull max sessions from hash reference