added a thread for analyzing layers