Db problems

Added some functionality