added params checking