fix the elsif so it checks for the correct value