improved param checking