fix missing if end