fixed check of params