fix sql
call db only once to check if user isadmin