jail function added,