fix if statement and default initialization for let