better type checking and added eede