fixed mistake. Error handling in case obj is nil