Fixed silly if bug