How to fix my conditional statement error?