A procedure for estimation of the upper bound for earthquake magnitudes