added db where statement but not working properly yet