added back error check