added error msg
added getter