Added check funds function.