Added Error Check