fix formatting plus sql error

Signed-off-by: Ippoippo <ippoippo-software@ippoippo-eco.com>