fix issue #18 -if statement should not exit function in functional form