added bootstrap + error handling for query