Added error handling to abstract class.