add check on the parameters before using them