Fixing error with type cast from String to Long