changed datbase code