fixed bug in conditional