restyled and added error capabilities