Added code to handle when contract doesn't exist.