added error handling to getSize