Fixing incorrect else statement for logerror