My int always becomes 0 after the loop ends