Added Error Checking