replaced in line conditional with if else for backward compatibility