fixed some layout and display issues
fixed database insert issue