added detect and throw command