removed debug statement
set layoutPath to 'pdf' only if layoutPath is NULL