Better styling
Added db error check