created new method to handle sql insertions