added query and user insert stuff