minor changes to layout, error handling