I made error checking more accurate.