improved: css classes and throw error function