added functions to handle oracle sequence