Updated to include more checks