Removed unnecessary 'while true do' loop