added check() function
added error message handling
added str_to_param()