added require and errors