much better way of handling it