fix broken if stmt