updated user interface and database query