Adding the right error check incase of pexpand_head call failure