added some param checks