fixed styling of errors; moved js funcs in lib.js;