bit more error checking..