fix syntax error
fixing some bugs
adding some database functionality