return error when range not found