check if smooth parameter exists before checking the size
fix logic bug I indroduced before, sorry for that
coding style