Adding the right error check incase of pexpand_head call failure

Adding the right error check incase of pexpand_head call failure