using where clause so that system not crashes for non existing users

Signed-off-by: Arpit Goyal <agmps17@gmail.com>