removed ! in findMail in main.js that was causing first message to always be picked. mail_list[i].id was a string, id was a int, so given it was !== and not !=, it was always passing on the first case. Additionally, the logic should be ==, not !=