fix problem with max user login
add comments after first code review