fixed issue - if else statement was incorrectly nested