add some param error checking