You have a assignment in an if statement. might cause undesired behaviour