check previous entry to make the script a bit more efficient