Fix for nil exception