changed loop to only print out message once