adds more error checking in get_params