better error handling
fails silently #TODO to fix