added check for empty params