error handling, trimming down.