more sturdy parameter check, delete empty params