fixed broken if statement