Fix method to account for nil