added check_procedure_type
removed duplicated check
changed range_check function
added check_range()