Error checking added]#