added error handling in the bare minimum. must add better messaging