we should wrap this in a try catch and call the listener in the case of an error?