updated to use bash mode