added bot trapping logic