Why do you need this "if", while $out can be passed as last parameter anyway?